package com.yuanren.em.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;

import java.util.Date;

@TableName("t_comment")
public class Comment extends Model<Comment> {
    
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    
    private Long userId;
    
    private Long goodId;
    
    private Long orderId;
    
    private Integer rating;
    
    private String content;
    
    private String images;
    
    private Date createTime;
    
    private Boolean isAnonymous;
    
    private String replyContent;
    
    private Date replyTime;
    
    // 关联字段，不在数据库中存储
    @TableField(exist = false)
    private String username;
    
    @TableField(exist = false)
    private String avatarUrl;
    
    @TableField(exist = false)
    private String goodName;
    
    @TableField(exist = false)
    private String goodImg;

    public Comment() {}

    public Comment(Long userId, Long goodId, Long orderId, Integer rating, String content, String images, Date createTime, Boolean isAnonymous) {
        this.userId = userId;
        this.goodId = goodId;
        this.orderId = orderId;
        this.rating = rating;
        this.content = content;
        this.images = images;
        this.createTime = createTime;
        this.isAnonymous = isAnonymous;
    }

    // Getters and Setters
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Long getGoodId() {
        return goodId;
    }

    public void setGoodId(Long goodId) {
        this.goodId = goodId;
    }

    public Long getOrderId() {
        return orderId;
    }

    public void setOrderId(Long orderId) {
        this.orderId = orderId;
    }

    public Integer getRating() {
        return rating;
    }

    public void setRating(Integer rating) {
        this.rating = rating;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getImages() {
        return images;
    }

    public void setImages(String images) {
        this.images = images;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Boolean getIsAnonymous() {
        return isAnonymous;
    }

    public void setIsAnonymous(Boolean isAnonymous) {
        this.isAnonymous = isAnonymous;
    }

    public String getReplyContent() {
        return replyContent;
    }

    public void setReplyContent(String replyContent) {
        this.replyContent = replyContent;
    }

    public Date getReplyTime() {
        return replyTime;
    }

    public void setReplyTime(Date replyTime) {
        this.replyTime = replyTime;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getAvatarUrl() {
        return avatarUrl;
    }

    public void setAvatarUrl(String avatarUrl) {
        this.avatarUrl = avatarUrl;
    }

    public String getGoodName() {
        return goodName;
    }

    public void setGoodName(String goodName) {
        this.goodName = goodName;
    }

    public String getGoodImg() {
        return goodImg;
    }

    public void setGoodImg(String goodImg) {
        this.goodImg = goodImg;
    }

    @Override
    public String toString() {
        return "Comment{" +
                "id=" + id +
                ", userId=" + userId +
                ", goodId=" + goodId +
                ", orderId=" + orderId +
                ", rating=" + rating +
                ", content='" + content + '\'' +
                ", images='" + images + '\'' +
                ", createTime=" + createTime +
                ", isAnonymous=" + isAnonymous +
                ", replyContent='" + replyContent + '\'' +
                ", replyTime=" + replyTime +
                ", username='" + username + '\'' +
                ", avatarUrl='" + avatarUrl + '\'' +
                ", goodName='" + goodName + '\'' +
                ", goodImg='" + goodImg + '\'' +
                '}';
    }
} 